package concurrent.thread.singleton;

/**
 * 懒汉式单例
 */
public class LanHanSingletonInstance {

	private static LanHanSingletonInstance instance = null;

	private LanHanSingletonInstance() {
		System.out.println(Thread.currentThread().getName() + "\t 构造方法");
	}

	public static LanHanSingletonInstance getInstance() {
		if (instance == null) {
			instance = new LanHanSingletonInstance();
		}
		return instance;
	}

	public synchronized static LanHanSingletonInstance suoGetInstance() {
		if (instance == null) {
			instance = new LanHanSingletonInstance();
		}
		return instance;
	}
}
